{template 'public/header'}

{template 'public/comhead'}

<link rel="stylesheet" type="text/css" href="../addons/zh_jdgjb/template/public/ygcss.css">

<style type="text/css">

    input[type="radio"] + label::before {

        content: "\a0"; /*不换行空格*/

        display: inline-block;

        vertical-align: middle;

        font-size: 16px;

        width: 1em;

        height: 1em;

        margin-right: .4em;

        border-radius: 50%;

        border: 2px solid #ddd;

        text-indent: .15em;

        line-height: 1; 

    }

    input[type="radio"]:checked + label::before {

        background-color: #44ABF7;

        background-clip: content-box;

        padding: .1em;

        border: 2px solid #44ABF7;

    }

    input[type="radio"] {

        position: absolute;

        clip: rect(0, 0, 0, 0);

    }

    .ygmargin{margin-top: 10px;color: #999;}

</style>

<ul class="nav nav-tabs">

    <span class="ygxian"></span>

    <div class="ygdangq">当前位置:</div>    

    <li class="active"><a href="javascript:void(0);">分销设置</a></li>

</ul>

<div class="main">

    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">

        <!--<input type="hidden" name="parentid" value="{$parent['id']}" />-->

        <div class="panel panel-default ygdefault">

            <div class="panel-heading wyheader">

                分销设置

            </div>

            <div class="panel-body">

            <div class="form-group">

                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启分销</label>

                    <div class="col-sm-9">

                        <label class="radio-inline">

                            <input type="radio" id="emailwy1" name="is_open" value="1" {if $item['is_open']==1}checked{/if} />

                            <label for="emailwy1">开启</label>

                        </label>

                        <label class="radio-inline">

                            <input type="radio" id="emailwy2" name="is_open" value="2" {if $item['is_open']==2  || empty($item['is_open'])}checked{/if} />

                            <label for="emailwy2">关闭</label>

                        </label>

                        <div class="ygmargin">(*开启后小程序端显示分销中心入口)</div> 

                    </div>

                    

                </div>

                <div class="form-group">

                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启分销商审核</label>

                    <div class="col-sm-9">

                        <label class="radio-inline">

                            <input type="radio" id="emailwy3" name="is_fx" value="1" {if $item['is_fx']==1 }checked{/if} />

                            <label for="emailwy3">开启</label>

                        </label>

                        <label class="radio-inline">

                            <input type="radio" id="emailwy4" name="is_fx" value="2" {if $item['is_fx']==2 || empty($item['is_fx'])}checked{/if} />

                            <label for="emailwy4">关闭</label>

                        </label>

                        <div class="ygmargin">(*开启后需要申请分销并后台审核通过才能成为分销商)</div>    

                    </div>

                    
                </div>

                <div class="form-group">

                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启二级分销</label>

                    <div class="col-sm-9">

                        <label class="radio-inline">

                            <input type="radio" id="emailwy7" name="is_ej" value="1" {if $item['is_ej']==1 }checked{/if} />

                            <label for="emailwy7">开启</label>

                        </label>

                        <label class="radio-inline">

                            <input type="radio" id="emailwy8" name="is_ej" value="2" {if $item['is_ej']==2 || empty($item['is_ej'])}checked{/if} />

                            <label for="emailwy8">关闭</label>

                        </label>    

                    </div>

                </div>

   <div class="form-group">
 
                 <label class="col-xs-12 col-sm-3 col-md-2 control-label">申请分销商图片</label>
 
                 <div class="col-sm-9">
 
                     {php echo tpl_form_field_image('img2', $item['img2'])}
 
                     <div class="ygmargin">*建议宽高比例 2:1</div>
 
                 </div>
 
             </div>
<!-- 
                <div class="form-group">

                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">申请分销商图片</label>

                    <div class="col-sm-9">

                        {php echo tpl_form_field_image('img2', $item['img2'])}

                        <div class="ygmargin">*建议宽高比例 2:1</div>

                    </div>

                </div>  -->

                

                <div class="form-group">

                  <label class="col-xs-12 col-sm-3 col-md-2 control-label">一级佣金</label>

                  <div class="col-sm-9">

                        <p class="input-group">

                             <input type="text" onkeyup="value=value.replace(/[^\d.]/g,'')" name="commission" value="{$item['commission']}" id="points" class="form-control" />

                             <span class="input-group-addon">%</span>

                        </p>

                        <div class="help-block">*一级下线消费时,分销商可获得佣金比例</div>

                  </div>

                </div>

                <div class="form-group">

                  <label class="col-xs-12 col-sm-3 col-md-2 control-label">二级佣金</label>

                  <div class="col-sm-9">

                        <p class="input-group">

                             <input type="text" onkeyup="value=value.replace(/[^\d.]/g,'')" name="commission2" value="{$item['commission2']}" id="points" class="form-control" />

                             <span class="input-group-addon">%</span>

                        </p>

                        <div class="help-block">*二级下线消费时,分销商可获得佣金比例</div>

                  </div>

                </div>



                <div class="form-group">

                  <label class="col-xs-12 col-sm-3 col-md-2 control-label">最低提现金额</label>

                    <div class="col-sm-9">

                        <p class="input-group">

                             <input type="text" name="tx_money" value="{$item['tx_money']}" id="points" class="form-control" />

                             <span class="input-group-addon">元</span>

                        </p>

                        <div class="help-block">*最低提现金额不能小于1元，建议填写整数，不填写为不限制</div>

                 </div>

                </div>

                <div class="form-group">

                  <label class="col-xs-12 col-sm-3 col-md-2 control-label">提现费率</label>

                  <div class="col-sm-9">

                        <p class="input-group">

                             <input type="number" name="tx_rate" value="{$item['tx_rate']}" id="points" class="form-control" />

                             <span class="input-group-addon">%</span>

                        </p>

                        <div class="help-block">*用户申请提现时，每笔申请提现扣除的费用，默认为空，即提现不扣费</div>

                  </div>

                </div>

                

                <div class="form-group">

                  <label class="col-xs-12 col-sm-3 col-md-2 control-label">分销商申请协议</label>

                  <div class="col-sm-9">

                       {php echo tpl_ueditor('fx_details',$item['fx_details']);}

                  </div>

                </div>
<!-- 
                <div class="form-group">

                  <label class="col-xs-12 col-sm-3 col-md-2 control-label">佣金提现协议</label>

                  <div class="col-sm-9">

                       {php echo tpl_ueditor('tx_details',$item['tx_details']);}

                  </div>

                </div> -->

                <div class="form-group">

                  <label class="col-xs-12 col-sm-3 col-md-2 control-label">分销商说明</label>

                  <div class="col-sm-9">

                       {php echo tpl_ueditor('instructions',$item['instructions']);}

                  </div>

                </div>



             </div>

        </div>

        <div class="form-group">

            <input type="submit" name="submit" value="提交" class="btn col-sm-3" style="color: white;background-color: #44ABF7;"/>

            <input type="hidden" name="token" value="{$_W['token']}" />

             <input type="hidden" name="id" value="{$item['id']}" />

        </div>

    </form>

</div>

<script type="text/javascript">

    $(function(){

        // $("#frame-9").addClass("in");

        $("#frame-9").show();

        $("#yframe-9").addClass("wyactive");

    })

</script>